<?php
/** 
 * Plugin 'rdt_button' for the 'ameos_formidable' extension.
 *
 * @author	Jerome Schneider <typo3dev@ameos.com>
 */


class tx_rdtbutton extends formidable_mainrenderlet {
	
	/*var $sMajixClass = "Button";
	var $aLibs = array(
		"rdt_button_class" => "res/js/button.js",
	);*/


	function _render() {
		return $this->_renderReadOnly();
	}

	function _renderReadOnly() {

		$this->skin_init("readonly");

		$sLabel = $this->getLabel();

		return $this->skin_apply(
			array(
				"label"		=> $sLabel,
				"name"		=> $this->_getElementHtmlName(),
				"id"		=> $this->_getElementHtmlId(),
				"value"		=> $sLabel,
				"addparams"	=> $this->_getAddInputParams(),
			),
			array(
				"input" => "<input type=\"button\" name=\"{name}\" id=\"{id}\" value=\"{value}\" {addparams} />",
				"__compiled" => "{input}",
			)
		);
	}

	function _renderOnly() {
		return TRUE;
	}
	
	function _readOnly() {
		return TRUE;
	}

	function _activeListable() {		// listable as an active HTML FORM field or not in the lister
		return $this->oForm->_defaultTrue("/activelistable/", $this->aElement);
	}
}


	if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/ameos_formidable/api/base/rdt_button/api/class.tx_rdtbutton.php"])	{
		include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/ameos_formidable/api/base/rdt_button/api/class.tx_rdtbutton.php"]);
	}

?>